#ifndef __OgreURLWriteFileStream_H__
#define __OgreURLWriteFileStream_H__
#pragma once

// Include stuff
#include "OgreURLWriteDataStream.h"

namespace Ogre
{
	/**
	 * @brief Base class of all stream data writer
	 */
	class _OgreURLExport URLWriteFileStream : public URLWriteDataStream
	{
	public:
		/**
		 * @brief Default constructor
		 */
		URLWriteFileStream();

		/**
		 * @brief Default destructor
		 */
		virtual ~URLWriteFileStream();

		/**
		 * @brief Opening file output stream
		 * @note Throw an exception if opening failed
		 */
		void open(const String& filename);

		/**
		 * @brief Closing opened file stream
		 */
		void close();

		/**
		 * @brief Overridden from WriteDataStream
		 * @copydoc WriteDataStream::writeData()
		 */
		size_t writeData(void* ptr, size_t size, size_t nmemb);

	protected:
		/// File stream
		std::ofstream mFile;
	};

} // end of namespace Ogre

#endif // include guard, end of #ifndef __OgreURLWriteFileStream_H__
